#include "StdAfx.h"
#include "MainMenuPainter.h"
#include "CMSGInforCon.h"





CMainMenuPainter::CMainMenuPainter(void):CContainerPainter()
{

}

void CMainMenuPainter::Paint(CDC* pDc, CContainer* pContainer, CRect& rc)
{
	int nCount = pContainer->m_vecControls.size();
	CMessageBoxCon* pContainerTmp = (CMessageBoxCon*)pContainer;


	if(!pContainerTmp->GetMaskBmp()->IsNull())
	{
		
		if (pContainerTmp->GetBackGnd())
		pDc->SelectBitmap(pContainerTmp->GetBackGnd());
		
		pDc->AlphaBlendEx(rc,pContainerTmp->GetMaskBmp()->m_hBitmap,rc,130);
        if (pContainerTmp->GetBackGnd()) 
		pContainer->SetBackGnd(CUtil::GetDCBmp(pDc));
	


	}
	else
	{
		pDc->FillSolidRect(rc,pContainerTmp->GetBackColor());
	}
  




	for(int i=0; i < nCount; i++)
		pContainer->m_vecControls.at(i)->Paint(pDc);


	
	

}